package com.partners.controller;

import com.partners.model.ApiResult;
import com.partners.service.AuthService;
import com.partners.utils.ApiResultUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**授权管理
 * @author liangyongle
 * @date 2018-12-13
 */
@RestController
@RequestMapping("auth")
public class AuthController {
    public final static String appId = "wx1b38cf3729aaa2a7";

    @Resource
    private AuthService authService;


    @GetMapping("/getToken")
    public ApiResult tokens(){
        return ApiResultUtil.ok(0);
    }

    @PostMapping("getMpCode")
    public ApiResult getMpCode(){
        Integer uid = 1;
        Integer customerId =3;
        Integer type = 1;
        String qrCodeUrl = authService.getMpCode(type,uid,customerId);
        return  ApiResultUtil.ok(qrCodeUrl);
    }

}
